package yl.codecraft.dsa.sort;

import com.codahale.metrics.MetricRegistry;

import java.util.Arrays;
import java.util.Random;

public class BaseSort {
    public static final MetricRegistry metrics = new MetricRegistry();
	public static void swap(int[] a, int i,int j){
		int tmp = a[i];
		a[i] = a[j];
		a[j] = tmp;
	}
	public static int[] generateRandomArray(int n){
		int[] a;
		 
		//生产随机数组
		a = new int[n];
		Random rand = new Random();
		for(int i=0;i<a.length;i++){
			a[i] = rand.nextInt(n);
		}
		System.out.println("generateRandomArray"+Arrays.toString(a));
		return a;
	}
}
